package com.ht.action;


import java.util.Map;

import com.ht.entity.Leave;
import com.ht.service.impl.JBPMServiceImpl;
import com.ht.util.BaseAction;
/**
 * 
 * @author ht 
 * 	2010 10 20
 *
 */
public class ExamAction extends BaseAction {
	private String taskId;
	private String result;
	JBPMServiceImpl jbpmServiceImpl = new JBPMServiceImpl();
	public String execute(){
		System.out.println("taskId="+taskId+",result="+result);
		Map leave=(Map) jbpmServiceImpl.getLeaveDetail(taskId).get(0);	//需要修改请假表中状态的数据，需要获得该记录
		if(result.equals("批准")){
			jbpmServiceImpl.updateLeave(leave, result);				//更新			
		}
		jbpmServiceImpl.completeTask(taskId, result);	//完成任务，进入下一个流程
		return "index";
	}
	public String getTaskId() {
		return taskId;
	}
	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
}
